package com.wanmait.employment.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wanmait.employment.entity.EntryTime;
import com.wanmait.employment.entity.MaritalStatus;
import com.wanmait.employment.entity.Nation;
import com.wanmait.employment.mapper.MaritalStatusMapper;
import com.wanmait.employment.service.MaritalStatusService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class MaritalStatusServiceImpl implements MaritalStatusService {

    @Resource
    private MaritalStatusMapper maritalStatusMapper;

//    @Override
//    public PageInfo<MaritalStatus> selectList(String title, int pageNum, int pageSize) {
//        PageHelper.startPage(pageNum,pageSize);
//        QueryWrapper<MaritalStatus> queryWrapper=new QueryWrapper<>();
//        queryWrapper.like("title",title);
//        List<MaritalStatus> nationList=maritalStatusMapper.selectList(queryWrapper);
//        PageInfo<MaritalStatus> maritalStatusPageInfo=new PageInfo<>(nationList);
//        return maritalStatusPageInfo;
//    }

    @Override
    public List<MaritalStatus> selectList(String title) {
        QueryWrapper<MaritalStatus>queryWrapper=new QueryWrapper<>();
        queryWrapper.like("title",title);
        return maritalStatusMapper.selectList(queryWrapper);    }

    @Override
    public void update(MaritalStatus maritalStatus) {
        maritalStatusMapper.updateById(maritalStatus);
    }

    @Override
    public void delete(Integer id) {
       maritalStatusMapper.deleteById(id);
    }

    @Override
    public void insert(MaritalStatus maritalStatus) {
       maritalStatusMapper.insert(maritalStatus);
    }

}
